﻿--ref : http://www.cnitblog.com/dotnetbbs/archive/2007/10/23/35247.html
--数据库存储:基本: 区->页->slot

--ref: 页, 区的基本关系 http://msdn.microsoft.com/en-us/library/ms190969(v=SQL.105).aspx

--页的类型及查看
--ref :对dbcc page的详细解释 http://blogs.msdn.com/b/sqlserverstorageengine/archive/2006/12/13/more-undocumented-fun_3a00_-dbcc-ind_2c00_-dbcc-page_2c00_-and-off_2d00_row-columns.aspx

DBCC IND('DB',TableA,-1)  --查看DB的TableA表包含哪些页
DBCC Page ('DB',1, 1)
--DBCC PAGE
--(
--['database name'|database id], -- can be the actual name or id of the database
--file number, -- the file number where the page is found
--page number, -- the page number within the file 
--print option = [0|1|2|3] -- display option; each option provides differing levels of information
--)

--索引, 关于dbcc page , 不错的两篇博文
--ref http://www.cnblogs.com/xwdreamer/archive/2012/07/17/2595878.html
--ref http://www.cnblogs.com/xwdreamer/archive/2012/07/18/2596984.html
--ref 索引的内部存储 http://www.cnblogs.com/xwdreamer/archive/2012/07/06/2579653.html

--查看表大小
--查看表Suppliers的大小
sp_spaceused Suppliers
--查看索引
SELECT  [first],[indid],[keycnt],[name] FROM sysindexes where id  = object_id('Department')